<%@page import="com.qdu.dao.OrderDao"%>
<%@page import="java.text.NumberFormat"%>
<%@page import="java.util.List"%>
<%@page import="java.*"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head><title>查看订单信息</title>
        <link type=text/css rel=stylesheet>
     <style>
            #div0{
                width:100%;
                height:50px;
                background-color:#FFCCCC;
                position:fixed;
                z-index:10;
                margin:-10px -10px 0px -10px;
            }
            #top-page{
                float:right;
                height:10px;
                white-space:nowrap;
                margin:25px 0px 0px 0px;

            }	
            #logo{
                height:50px;
                width:50px;
                float:left;
            }
            
        </style>
    </head>
    <body leftMargin=0 topMargin=0 bgColor=#F0FFFF>
        <div id="div0">
            <div id="logo">
                <img src="img/logo.jpg" style="width:100%;height:100%; margin-left:15%">
            </div>
            <div id="top-page" align="right" style="margin-right:5%">
                <div align=center>
                    <a href="/index.jsp"><FONT color=#ffffff>首页</FONT></a><FONT color=#ffffff> │ </FONT>
                    <a href="/moregood.jsp"><FONT color=#ffffff>最新图书</FONT></a><FONT color=#ffffff> │ </FONT>
                    <a href="/fenlei.jsp"><FONT color=#ffffff>图书分类</FONT></a><FONT color=#ffffff> │ </FONT>
                    <a href="/moretuijian.jsp"><FONT color=#ffffff>特价图书</FONT></a><FONT color=#ffffff> │ </FONT>
                    <a href="/admin/login.jsp" target=_blank><FONT color=#ffffff>管理入口</FONT></a>
                </div>
            </div>
        </div>
        <br><br>
        <div align="center">
            <img src="img/top.jpg" width="779">
</div>
<%
String message = (String)request.getAttribute("message");
	if(message == null){
			message = "";
	}
	if (!message.trim().equals("")){
		out.println("<script language='javascript'>");
		out.println("alert('"+message+"');");
		out.println("</script>");
	}
	request.removeAttribute("message");

	String name=(String)session.getAttribute("name");
	if(name==null){
		response.sendRedirect("/WSSD/admin/login.jsp");
	}
	else{
 %>
    <table width="100%" height="100%" cellpadding="0" cellspacing="0">
  <tr>
    <td height="121" align="center" valign="top" bgcolor="#FFFFFF"><div align="left"><br>
            <span class="black14">　<strong>当前位置:</strong>定单管理</span><br>
    </div>
        <table width="98%" cellpadding="0" cellspacing="0">
          <tr>
            <td width="96" height="1" bgcolor="#5D8191" class="black14"></td>
          </tr>
          <tr>
            <td height="2" align="left" bgcolor="#5D8191" class="w12"></td>
          </tr>
          <tr bgcolor="#cccccc">
            <td align="center" bgColor=#ffffff><br>
              <br>
                    <table width="100%" cellpadding="0" cellspacing="0">
                        <tr>
                          <td width="100%" height="20" colspan="2" bgcolor="#009999"><p class="w14">定单详细信息</p></td>
                        </tr>
                    
                        <tr>
                          <td width="100%" height="100" align="center" bgColor=#ffffff><span class="hb"> <br>
                            </span>
                              <table width="70%" cellpadding="0" cellspacing="0">
                                <tr>
                                  <td align="left" colspan=4  height="30">定单号:</td>								
                                </tr>
                                </table>
                     <table width="70%" cellpadding="0" cellspacing="0" border=1>
                                <tr>
                                  <td align="center"  height="30">书名</td>
                                  <td align="center">数量</td>
                                  <td align="center">单价</td>
                                  <td align="center">是否带光盘</td>
                                </tr>  
         <%
         	String number=request.getParameter("number").trim();//获取number并将string类型数据的前后端空格去掉
         	float f=0;
         	List list=new OrderDao().getOrder(number);
         	for(int i=0;i<list.size();i++){
         		List list2=(List)list.get(i);
         		f+=Integer.parseInt(list2.get(1).toString())*Float.parseFloat(list2.get(2).toString());
         %>
         		<tr>
				  <td align="center"  height="30"><a href="admin/bookinfo.jsp?id=<%=list2.get(4).toString() %>" target="_blank"><%=list2.get(0).toString() %></a></td>
				  <td align="center"><%=list2.get(1).toString() %></td>
				  <td align="center"><%=list2.get(2).toString() %></td>
				  <td align="center"><%=list2.get(3).toString() %></td>
				</tr>  
         <%
                  	}
         %>    </table>  
		        <table>                                                                
             <tr>
             <td colspan=4 align="right">总金额：<%=f %>元</td>
             </tr>
                            </table></td>
                        </tr>
                        <tr>
                          <td height="30" colspan="2" align="center" bgColor=#ffffff><br>
                              <table width="200" cellpadding="0" cellspacing="0">
                                <tr>
                                  <td align="center"><input name="Submit32" type="button" class="black12" value="关闭"  onclick="window.close()"></td></tr></table>
                          </td>
                        </tr>
                      </table>
                        <br>
                    </td>
                  </tr>
                </table>
                <br>
                <br></td>
          </tr>
      </table>
<br>
<div style="background:#CCFFFF;color:white;height:13;"align=center >2020-2030 网上书店  版权所有</div>
<div style="background:#FFCCCC;color:white;height:13;"align=center >2020-2030 网上书店  版权所有</div>
<div style="background:#CCFFFF;color:white;height:13;"align=center >2020-2030 网上书店  版权所有</div>
</body>
<%
    } 
%>
</html>
